//
//  Task.m
//  smart_transferor
//
//  Created by  on 11-11-2.
//  Copyright (c) 2011年 tencent. All rights reserved.
//

#import "Task.h"
@implementation SendingConn
@synthesize sendTask;
@synthesize dstIp;
@synthesize infd;
@synthesize sentBytes;
@synthesize _cfSocket;
@synthesize touchTimeStamp;
-(id)init
{
    self = [super init];
    if (self)
    {
        sendTask = nil;
        dstIp = nil;
        infd = -1;
        sentBytes = 0;
        _cfSocket = nil;
        touchTimeStamp = 0;
    }
    return self;
}
-(void)dealloc
{
    free(dstIp);
    [super dealloc];
}
@end

@implementation SendTask

@synthesize sendId;
@synthesize fileInfo;
@synthesize startTimeStamp;
@synthesize foundedTargets;
@synthesize transferTargets;
@synthesize sendingConns;

-(id)init
{
    self = [super init];
    if (self)
    {
        sendId = 0;
        fileInfo = nil;
        startTimeStamp = 0;
        foundedTargets = 0;
        transferTargets = 0;
        sendingConns = [[NSMutableArray alloc]init];
    }
    return self;
}

-(void)dealloc
{
    [fileInfo release];
    [sendingConns release];
    [super dealloc];
}
@end

@implementation RecvingConn
@synthesize recvTask;
@synthesize outfd;
@synthesize recvLength;
@synthesize _cfSocket;
@synthesize touchTimeStamp;
- (id)init 
{
    self = [super init];
    if (self) 
    {
        recvTask = nil;
        outfd = 0;
        recvLength = 0;
        _cfSocket = nil;
        touchTimeStamp = 0;
    }
    return self;
}

@end

@implementation RecvTask
@synthesize srcIp;
@synthesize srcSendId;
@synthesize fileInfo;
@synthesize startTimeStamp;
@synthesize recvId;
@synthesize recvingConn;
- (id)init 
{
    self = [super init];
    if (self) 
    {
        srcIp = nil;
        srcSendId = 0;
        fileInfo = nil;
        startTimeStamp = 0;
        recvId = 0;
        recvingConn = nil;
    }
    return self;
}
-(void)dealloc
{
    [recvingConn release];
    [fileInfo release];
    free(srcIp);
    [super dealloc];
}
@end
